// import { mapState, mapMutations } from "vuex";
import cTitle from "components/title";
// var haveShop = false;

export default {
  data() {
    return {
      imgSrc:''
    };
  },

  mounted() {
  },
  methods: {
    getdata(){
      $http
        .get("plugin.store-cashier.frontend.store.goods-buy.get-collection-code")
        .then(res => {
          if (res.result === 1) {
            this.imgSrc = res.data + "?" + Math.random();
          } else {
            this.$dialog.alert({ message: res.msg });
          }
        });
    },
    async onResetCode() {
      let { result, msg, data } = await $http.get("plugin.store-cashier.frontend.store.goods-buy.resetCollectionCode",{store_id: this.$route.params.store_id},".");
      this.$toast(msg);
      if (result == 0) return;
      this.imgSrc = data + "?" + Math.random();
    }
  },
  computed: {},
  activated() {
    this.getdata();
  },
  created() {

  },
  components: { cTitle }
};
